home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / diffs / texinfo-.1 / info / pc_term.c < prev    next >
Encoding:
Text File  |  1994-08-05  |  3.7 KB  |  177 lines

  1. *** orig/texinfo-.1/info/pc_term.c    Sun Aug 29 18:41:06 1993
  2. --- src/texinfo-.1/info/pc_term.c    Thu Jul 21 01:11:48 1994
  3. ***************
  4. *** 0 ****
  5. --- 1,171 ----
  6. + /* pc_term.c */
  7. + /* This file is part of the MSDOS-DJGPP-port of the GNU standalone
  8. +    Info-reader
  9. +    This program is free software; you can redistribute it and/or modify
  10. +    it under the terms of the GNU General Public License as published by
  11. +    the Free Software Foundation; either version 2, or (at your option)
  12. +    any later version.
  13. +    This program is distributed in the hope that it will be useful,
  14. +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. +    GNU General Public License for more details.
  17. +    You should have received a copy of the GNU General Public License
  18. +    along with this program; if not, write to the Free Software
  19. +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. +  */
  21. + #include <stdio.h>
  22. + #include <pc.h>
  23. + #include <gppconio.h>
  24. + #include "pc_term.h"
  25. + #include "terminal.h"
  26. + #include "termdep.h"
  27. + #define max(x,y) ((x)>(y) ? (x) : (y))
  28. + #define min(x,y) ((x)<(y) ? (x) : (y))
  29. + #define keywait  do {char dummy=0;\
  30. +                      fflush(stdout);\
  31. +                      while (!kbhit()) ;\
  32. +                      dummy=getkey();\
  33. +                  } while (0);
  34. + static struct text_info pc_info; /* struct to hold the conio-status */
  35. + void pc_begin_inverse()
  36. + {
  37. +     textbackground(7);
  38. +     textcolor(0);
  39. + }
  40. + void pc_end_inverse()
  41. + {
  42. +     textbackground(0);
  43. +     textcolor(7);
  44. + }
  45. + void pc_prep_terminal()
  46. + {
  47. +   textattr(0x07);
  48. + }
  49. + void pc_unprep_terminal()
  50. + {
  51. +     ScreenClear(); /* to leave behind a clean screen */
  52. + }
  53. + void pc_up_line()
  54. + {
  55. +     int x, y;
  56. +     ScreenGetCursor(&y, &x);
  57. +     ScreenSetCursor(max(y-1, 0), x);
  58. + }
  59. + void pc_down_line()
  60. + {
  61. +     int x, y;
  62. +     ScreenGetCursor(&y, &x);
  63. +     ScreenSetCursor(min(screenheight-1, y+1), x);
  64. + }
  65. + void pc_clear_screen()
  66. + {
  67. +     ScreenClear();
  68. + }
  69. + void pc_clear_to_eol()
  70. + {
  71. +     clreol(); /* perhaps to be replaced by a loop */
  72. + }
  73. + void pc_get_screen_size()
  74. + {
  75. +     screenwidth  = ScreenCols();
  76. +     screenheight = ScreenRows();
  77. + }
  78. + void pc_goto_xy(x, y)
  79. + int x, y;
  80. + {
  81. +     ScreenSetCursor(y, x); /* yes, pc.h says ...(row, column) !! */
  82. + }
  83. + void pc_initialize_terminal(term_name)
  84. +     char *term_name;
  85. + {
  86. +     gppconio_init();
  87. +     gettextinfo(&pc_info);
  88. +     screenwidth  = ScreenCols();
  89. +     screenheight = ScreenRows();
  90. + }
  91. + void pc_new_terminal(term_name)
  92. +     char *term_name;
  93. + {
  94. +     pc_initialize_terminal(term_name);
  95. + }
  96. + void pc_put_text(string)
  97. + char *string;
  98. + {
  99. +     cputs(string);
  100. + }
  101. + void pc_ring_bell()
  102. + {
  103. +     printf("%c",'\a');
  104. + }
  105. + void pc_write_chars(string, nchars)
  106. +     char *string;
  107. +     int nchars;
  108. + {
  109. +     cprintf("%.*s",nchars, string);
  110. + }
  111. + void pc_scroll_terminal(start, end, amount)
  112. +     int start, end, amount;
  113. + {
  114. +     movetext(pc_info.winleft, start, pc_info.winright, end,
  115. +         pc_info.winleft, start+amount);
  116. + }
  117. + int       tputs(char *a, int b, int (*c)())
  118. + {
  119. +   perror("tputs");
  120. + }
  121. + char*     tgoto(char*a, int b, int c)
  122. + {
  123. +   perror("tgoto");
  124. + }
  125. + int       tgetnum(char*a)
  126. + {
  127. +   perror("tgetnum");
  128. + }
  129. + int       tgetflag(char*a)
  130. + {
  131. +   perror("tgetflag");
  132. + }
  133. + char*     tgetstr(char *a, char **b)
  134. + {
  135. +   perror("tgetstr");
  136. + }
  137. + int       tgetent(char*a, char*b)
  138. + {
  139. +   perror("tgetent");
  140. + }
  141. + int       sigblock(int a)
  142. + {
  143. +   return 0;
  144. + }
  145.